﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using compshop.Modules.ListOfTransportationBills.Presenter;

namespace compshop.Modules.ListOfTransportationBills.View
{
    /// <summary>
    /// Логика взаимодействия для TransportationBillsListView.xaml
    /// </summary>
    public partial class TransportationBillsListView : UserControl, IViewTransportationBillsList
    {

        public TransportationBillsListView()
        {
            InitializeComponent();
            btnAdd.Click += new RoutedEventHandler(btnAdd_Click);
        }

        void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            Presenter.addTransportationBill();
            lvTransportationBillList.Items.Refresh();
        }
        public TransportationBillsListView(TransportationBillsListPresenter presenter)
            : this()
        {
            Presenter = presenter;
            Presenter.View = this;
        }
        public TransportationBillsListPresenter Presenter
        {
            get { return DataContext as TransportationBillsListPresenter; }
            set { DataContext = value; }
        }
    }
}
